package com.xhsj.user.sms.purchase.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xhsj.user.sms.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 采购订单子任务
 * </p>
 *
 * @author suxiaolin
 * @since 2020-06-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tb_purchase_order_subtask")
public class TbPurchaseOrderSubtask extends BaseEntity<TbPurchaseOrderSubtask> {

    private static final long serialVersionUID = 1L;

    /**
     * 采购订单id
     */
    @TableField("purchase_order_id")
    private String purchaseOrderId;

    /**
     * 采购任务id
     */
    @TableField("purchase_task_id")
    private String purchaseTaskId;

    /**
     * 合同申请id
     */
    @TableField("contract_apply_id")
    private String contractApplyId;

    /**
     * 节点名称
     */
    @TableField("node_name")
    private String nodeName;

    /**
     * 供应商名称
     */
    @TableField("supplier_name")
    private String supplierName;

    /**
     * 总金额
     */
    @TableField("total_money")
    private BigDecimal totalMoney;

    /**
     * 付款方式 1 一次结清 2 多次结清
     */
    @TableField("payment_way")
    private Integer paymentWay;

    /**
     * 初拟首付比例
     */
    @TableField("advance_proportion")
    private Integer advanceProportion;

    /**
     * 初拟二期款比例
     */
    @TableField("second_proportion")
    private Integer secondProportion;

    /**
     * 初拟尾款比例
     */
    @TableField("final_proportion")
    private Integer finalProportion;

    /**
     * 提交状态 1 保存 2 提交
     */
    @TableField("submit_status")
    private Integer submitStatus;

    /**
     * 物料不良记录 0无 1有
     */
    @TableField("bad_records")
    private Integer badRecords;

    /**
     * 发起商务协调 0未发 1发起
     */
    @TableField("business_negotiation")
    private Integer businessNegotiation;

    /**
     * 子任务编号
     */
    @TableField("subtask_number")
    private String subtaskNumber;

    /**
     * 归属项目
     */
    @TableField("belong_project")
    private String belongProject;

    /**
     * 采购类别
     */
    @TableField("category")
    private String category;

    /**
     * 期望到货时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("arrival_time")
    private LocalDateTime arrivalTime;

    /**
     * 预算范围 0预算内  1预算外
     */
    @TableField("budget_range")
    private String budgetRange;

    /**
     * 采购周期
     */
    @TableField("purchase_cycle")
    private String purchaseCycle;

    /**
     * 终止合同 0无 1有
     */
    @TableField("termination_contract")
    private Integer terminationContract;

    /**
     * 送样次数
     */
    @TableField("sample_delivery_times")
    private Integer sampleDeliveryTimes;

    /**
     * 经办人
     */
    @TableField("agent")
    private String agent;

    /**
     * 部门id
     */
    @TableField("dept_id")
    private Integer deptId;

    /**
     * 采购商品列表
     */
//    @Valid
    @TableField(exist = false)
    private List<TbPurchaseSubtaskList> purchaseOrderGoodsList;

    /**
     * 二期款金额
     */
    @TableField(exist = false)
    private String secondAmount;
    /**
     * 尾款金额
     */
    @TableField(exist = false)
    private String finalAmount;

    @TableField("total_number")
    private Integer totalNumber;  //总数量


    @TableField("total_back_number")
    private Integer totalBackNumber; //退货

    @TableField("total_instorage_number")
    private Integer totalInStorageNumber; //入库数量

    @TableField(exist = false)
    private String payMentId;


    @TableField(exist = false)
    private String processTaskId;


}
